package com.demo.study.thread;

/**
 * @author leiliang
 * @version 1.0
 * @Description   用户线程和守护线程
 * @date 2021/1/5 17:15
 */
public class Thread004 {

    public static void main(String[] args) {
        Thread thread = new Thread(() ->
        {
            while (true){

            }
        }
        );
        thread.setDaemon(false); //false 用户线程
        thread.start();
        System.out.printf(Thread.currentThread().getName()+"主线程停止");
    }
}
